For example, a song with words "I AM X" can transform into a dubstep remix as "WUBWUBIWUBAMWUBWUBX" and cannot transform into "WUBWUBIAMWUBX".
移除字串中的 WUB
,開頭和結尾不能有空白
(song-decoder "WUBWEWUBAREWUBWUBTHEWUBCHAMPIONSWUBMYWUBFRIENDWUB")
; => WE ARE THE CHAMPIONS MY FRIEND
;; trim: remove white space from both start and end
(ns dubstep)
(defn song-decoder [song]
(clojure.string/trim (clojure.string/replace song #"(WUB)+" " "))
)